import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import axios from './api/config';
import * as api from './api';
import "@/assets/css/reset.css";
import Tinymce from 'tinymce';
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

Vue.config.productionTip = false;
Vue.use(ElementUI);

Vue.prototype.$axios = axios;
Vue.prototype.$api = api;
Vue.prototype.$tinymce = Tinymce;
/**
 * 注册components文件夹中的 全局注册
 */
["Button"].forEach(componentName => {
  const { default: component } = require(`./components/${componentName}`);
  Vue.component(component.name, component);
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
